<?php
/**
 * @author trunghpb@vnext.vn
 */
class TopController extends selfController {

    public function eventPageLoad() {
        $view	= new TopView();	// helper
        $view->page_load();
    }

    public function eventNotDefinedClick() {

    }

    public function eventHelloAdmin() {

    }

    public function before() {
        if(!$this->authentication->isValid()) {
            $this->throwPage($this->_conf->error_page);
        }
    }

    public function after() {
    }

    public function initialize() {
        $this->authentication = new AuthenticationUtl();
        $rollNormal = new RollUtl($this->app->client_user); // roll_id
        $rollNormal->addEvent('page_load', 'not_defined_click');
        $this->authentication->add($rollNormal);

        $rollAdmin = $rollNormal->addEvent('hello_admin');
        $this->authentication->add($rollAdmin);
    }
}
?>

